GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
- gint width, focus_width;
-
- gtk_widget_style_get (widget,
- "focus-line-width", &focus_width,
- NULL);
+ gint width;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
gtk_widget_get_allocation (widget, &allocation);
- width = allocation.width - 2 * focus_width;
+ width = allocation.width;
/* constrain the handle within the trough width */
if (position > (width / 2) - padding.right)
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
- gint width, slider_width, focus_width;
+ gint width, slider_width;
PangoLayout *layout;
PangoRectangle logical_rect;
gtk_widget_style_get (widget,
"slider-width", &slider_width,
- "focus-line-width", &focus_width,
NULL);
- slider_width = MAX (slider_width, 3 * focus_width);
-
/* Translators: if the "on" state label requires more than three
* glyphs then use MEDIUM VERTICAL BAR (U+2759) as the text for
* the state
GtkStyleContext *context;
GtkStateFlags state;
GtkBorder padding;
- gint height, focus_width, slider_width, min_height;
+ gint height, slider_width, min_height;
PangoLayout *layout;
PangoRectangle logical_rect;
gchar *str;
gtk_widget_style_get (widget,
"slider-width", &slider_width,
- "focus-line-width", &focus_width,
NULL);
- min_height = MAX (slider_width * 0.6, 3 * focus_width);
+ min_height = slider_width * 0.6;
str = g_strdup_printf ("%s%s",
C_("switch", "ON"),
if (gtk_widget_has_visible_focus (widget))
{
- gint focus_width;
-
- gtk_widget_style_get (widget,
- "focus-line-width", &focus_width,
- NULL);
-
gtk_render_focus (context, cr,
- handle.x + focus_width, handle.y + focus_width,
- handle.width - focus_width*2, handle.height - focus_width*2);
+ handle.x, handle.y,
+ handle.width, handle.height);
}
return FALSE;